home *** CD-ROM | disk | FTP | other *** search
/ Aminet 52 / Aminet 52 (2002)(GTI - Schatztruhe)[!][Dec 2002].iso / Aminet / game / patch / WHDIGamesS-T.lzh / SuperMethaneBros.lha / SuperMethaneBrosHD / Install next >
Text File  |  2001-02-03  |  6KB  |  286 lines

  1. ;****************************
  2.  
  3. (set #sub-dir "")                ;sub directory containing data files
  4. (set #readme-file "ReadMe")            ;name of the readme file
  5. (set #highs-file "SuperMethaneBros.highs")    ;name of the high score file
  6.  
  7. (procedure P_MakeImages
  8.   (if
  9.     (= #version 0)        ;Disk version
  10.     (
  11.       (set #CI_disknum 1)
  12.       (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  13.       (set #CI_disklen 901120)
  14.       (set #CI_skiptrk 159)
  15.       (P_CreateImage)
  16.  
  17.       (set #CI_disknum 2)
  18.       (set #CI_diskname ("%s Disk %ld" @app-name #CI_disknum))
  19.       (set #CI_disklen 901120)
  20.       (set #CI_skiptrk 159)
  21.       (P_CreateImage)
  22.     )
  23.     (
  24.       (askdisk            ;CD32 version
  25.         (dest "Super_Methane_Brothers")
  26.         (prompt "\nInsert CD-ROM \"Super_Methane_Brothers\" in any drive!")
  27.         (help @askdisk-help)
  28.         (assigns)
  29.       )
  30.       (copyfiles
  31.         (help @copyfiles-help)
  32.         (source "Super_Methane_Brothers:")
  33.         (dest #dest)
  34.         (pattern "~(s)")
  35.       )
  36.       (copyfiles
  37.         (help @copyfiles-help)
  38.         (source "OSEmu.400")
  39.         (dest #dest)
  40.       )
  41.     )
  42.   )
  43. )
  44.  
  45. ;****************************
  46. ;----------------------------
  47. ; checks if given program is installed, if not abort install
  48. ; #program - to check
  49.  
  50. (procedure P_ChkRun
  51.   (if
  52.     (= 0 (run ("cd SYS:\nWhich %s" #program)))
  53.     ("")
  54.     (abort 
  55.       (cat
  56.     "You must install \"" #program "\" first!\n"
  57.     "It must be accessible via the path.\n"
  58.     "You can find it in the WHDLoad package."
  59.       )
  60.     )
  61.   )
  62. )
  63.  
  64. ;----------------------------
  65. ; Create Image using DIC
  66. ; #dest        - path to save image in
  67. ; #CI_disknum  - number of the disk image to create
  68. ; #CI_diskname - label of the disk
  69. ; #CI_disklen  - length of disk image to create
  70. ; #CI_skiptrk  - track to skip, -1 means no skip
  71. ; #CI_drive    - drive to create image from
  72.  
  73. (procedure P_CreateImage
  74.   (message
  75.     (cat
  76.     "\nInsert \"" #CI_diskname "\" into drive " #CI_drive " !\n\n"
  77.     "(make sure it's the right disk because it will not be checked)"
  78.     )
  79.   )
  80.   (if
  81.     (>= #CI_skiptrk 0)
  82.     (set #option (cat " SKIPTRACK=" #CI_skiptrk))
  83.     (set #option "")
  84.   )
  85.   (if
  86.     (= 0
  87.       (run 
  88.         (cat
  89.           "cd \"" #dest "\"\n"
  90.           "DIC " #CI_drive " FD=" #CI_disknum " LD=" #CI_disknum " SIZE="
  91.           #CI_disklen #option " PEDANTIC >CON:///1000//CLOSE"
  92.         )
  93.       )
  94.     )
  95.     (run ("FileNote %s Quiet" #CI_diskname))
  96.     (abort "\"DIC\" has failed to create a diskimage")
  97.   )
  98. )
  99.  
  100. ;****************************
  101.  
  102. (if
  103.   (exists #readme-file)
  104.   (if
  105.     (= 0 (run ("SYS:Utilities/Multiview %s" #readme-file)))
  106.     ("")
  107.     (run ("SYS:Utilities/More %s" #readme-file))
  108.   )
  109. )
  110.  
  111. (set #program "WHDLoad")
  112. (P_ChkRun)
  113.  
  114. (set #program "DIC")
  115. (P_ChkRun)
  116.  
  117. ;----------------------------
  118.  
  119. (set #version
  120.   (askchoice
  121.     (prompt "\nWhich version would you like to install?\n")
  122.     (default 0)
  123.     (choices "2 disk version" "CD32 version")
  124.     (help @askchoice-help)
  125.   )
  126. )
  127. (if
  128.   (= #version 0)
  129.   (set #versionname ("%s" @app-name))
  130.   (set #versionname ("%sCD32" @app-name))
  131. )
  132.  
  133. ;----------------------------
  134.  
  135. (if
  136.   (= #version 0)
  137.   (
  138.     (if                ; in expert mode ask for source drive
  139.       (= @user-level 2)
  140.       (
  141.         (set #CI_drive
  142.           (askchoice
  143.         (prompt "Select source drive for diskimages")
  144.         (default 0)
  145.         (choices "DF0:" "DF1:" "RAD:" "Enter Device")
  146.         (help @askchoice-help)
  147.           )
  148.         )
  149.         (select #CI_drive
  150.           (set #CI_drive "DF0:")
  151.           (set #CI_drive "DF1:")
  152.           (set #CI_drive "RAD:")
  153.           (set #CI_drive
  154.             (askstring
  155.               (prompt "Select source drive for diskimages")
  156.               (default "DF0:")
  157.               (help @askstring-help)
  158.             )
  159.           )
  160.         )
  161.       )
  162.       (set #CI_drive "DF0:")
  163.     )
  164.   )
  165.   (set #sub-dir "data")        ;sub directory containing data files
  166. )
  167.  
  168. (set @default-dest
  169.   (askdir
  170.     (prompt 
  171.       (cat
  172.     "Where should \"" #versionname "\" be installed ?\n"
  173.     "A drawer \"" #versionname "\" will automatically created."
  174.       )
  175.     )
  176.     (help @askdir-help)
  177.     (default @default-dest)
  178.     (disk)
  179.   )
  180. )
  181. (set #dest (tackon @default-dest #versionname))
  182. (if
  183.   (exists #dest)
  184.   (
  185.     (set #choice
  186.       (askbool
  187.         (prompt
  188.           (cat
  189.             "\nDirectory \"" #dest "\" already exists.\n"
  190.             "Should it be deleted?"
  191.           )
  192.         )
  193.         (default 1)
  194.         (choices "Delete" "Skip")
  195.         (help @askbool-help)
  196.       )
  197.     )
  198.     (if
  199.       (= #choice 1)
  200.       (run ("Delete \"%s\" \"%s.info\" All" #dest #dest))
  201.     )
  202.   )
  203. )
  204. (makedir #dest
  205.   (help @makedir-help)
  206.   (infos)
  207. )
  208.  
  209. ;----------------------------
  210.  
  211. (copyfiles
  212.   (help @copyfiles-help)
  213.   (source ("%s.Slave" #versionname))
  214.   (dest #dest)
  215. )
  216. (if
  217.   (exists ("%s.newicon" @app-name))
  218.   (set #icon
  219.     (askchoice
  220.       (prompt "\nWhich icon would you like to install ?\n")
  221.       (default 0)
  222.       (choices "Normal" "NewIcon" "GlowIcon")
  223.       (help @askchoice-help)
  224.     )
  225.   )
  226.   (set #icon 0)
  227. )
  228. (select #icon
  229.   (set #icon ("%s.inf" @app-name))
  230.   (set #icon ("%s.newicon" @app-name))
  231.   (set #icon ("%s.glowicon" @app-name))
  232. )
  233. (copyfiles
  234.   (help @copyfiles-help)
  235.   (source #icon)
  236.   (newname ("%s.info" #versionname))
  237.   (dest #dest)
  238. )
  239. (tooltype
  240.   (dest (tackon #dest #versionname))
  241.   (settooltype "SLAVE" ("%s.slave" #versionname))
  242. )
  243. (if
  244.   (exists #readme-file)
  245.   (copyfiles
  246.     (help @copyfiles-help)
  247.     (source #readme-file)
  248.     (dest #dest)
  249.   )
  250. )
  251. (if
  252.   (exists ("%s.info" #readme-file))
  253.   (copyfiles
  254.     (help @copyfiles-help)
  255.     (source ("%s.info" #readme-file))
  256.     (dest #dest)
  257.   )
  258. )
  259.  
  260. (if
  261.   (= #sub-dir "")
  262.   ("")
  263.   (
  264.     (set #dest (tackon #dest #sub-dir))
  265.     (makedir #dest
  266.       (help @makedir-help)
  267.     )
  268.   )
  269. )
  270.  
  271. (if
  272.   (exists #highs-file)
  273.   (copyfiles
  274.     (help @copyfiles-help)
  275.     (source #highs-file)
  276.     (dest #dest)
  277.   )
  278. )
  279.  
  280. (P_MakeImages)
  281.  
  282. ;----------------------------
  283.  
  284. (exit)
  285.  
  286.